{include file="pub_header.htm"}
<div class="out_table">
<table width="100%" cellpadding="6" cellspacing="6" border="0" align="center" class="frame_table">
  <tr>
    <td width="20%" align="center" valign="top" bgcolor="#EEEEEE">
      {include file="pub_submenu.htm"}
    </td>
    <td width="80%" align="center" valign="top" bgcolor="#FFFFFF">

      <div class="right_table">
      <table width="100%" cellpadding="3" cellspacing="0" border="0" align="center" class="current_place">
        <tr>
          <td align="left" nowrap>&nbsp;
            <a href="{$control_admin}" target="_self" class="current_place">管理首页</a>
            &raquo; <a href="{$control_admin}?act=config" target="_self" class="current_place">系统设置</a>
            {if $config_sort_info.cs_id != ""}
            &raquo; <a href="{$control_admin}?act=config&cs_id={$config_sort_info.cs_id}" target="_self" class="current_place">{$config_sort_info.cs_name}</a>
            {/if}
          </td>
          <td align="right" nowrap>
          &nbsp;
          </td>
        </tr>
      </table>
      </div>

      {if $config_sort_sub|@is_array && $config_sort_sub|@count > 0}
      <div class="space"></div>
      <div class="right_table">
      <table width="100%" cellpadding="3" cellspacing="0" border="0" align="center" class="block_group">
        <tr align="left" class="block_header">
          <td>类别</td>
        </tr>
        <tr align="left">
          <td>
          {foreach name=config_sort_sub from=$config_sort_sub item=config_sort_sub}
            <a href="{$control_admin}?act=config&cs_id={$config_sort_sub.cs_id}" target="_self">{$config_sort_sub.cs_name}</a>
            {if $smarty.foreach.config_sort_sub.last != true}│{/if}
          {/foreach}
          </td>
        </tr>
      </table>
      </div>
      {/if}
      {if $config_list|@is_array && $config_list|@count > 0}
      <div class="space"></div>
      <div class="right_table">
      <form id="config_amend" name="config_amend" method="post" action="javascript:void(null);" enctype="multipart/form-data">
      <table width="100%" cellpadding="3" cellspacing="0" border="0" align="center" class="block_group">
        <tr align="left" class="block_header">
          <td colspan="3">{if $config_sort_info.cs_id != ""}{$config_sort_info.cs_name}{/if}</td>
        </tr>
        {foreach name=config_list from=$config_list item=config_list}
        <tr>
          <td width="20%" class="block_left">{$config_list.subject|str_entag:'space,br'}</td>
          <td width="50%" class="block_right">
          <table width="100%" border="0" cellspacing="0" cellpadding="1">
          {if $config_list.param|@is_array && $config_list.param|@count > 0}
            {foreach name=config_list_option from=$config_list.param key=key item=config_list_option}
            <tr>
              {if $config_list_option.subject != ""}
              <td width="30%" class="block_left">{eval var=$config_list_option.subject}</td>
              <td width="70%" class="block_right">
              {else}
              <td class="block_right">
              {/if}
                {if $config_list_option.from == "database"}
                  {return_db_list option=$config_list_option.option item=config_list_option_value}
                {else}
                  {assign var="config_list_option_value" value=$config_list_option.option}
                {/if}
                {if $config_list_option.type == "select"}
                  {if $config_list_option_value|@is_array && $config_list_option_value|@count > 0}
                    {if $config_list.if_multi == '1'}
                      <select id="config[{$config_list.name}][{$config_list_option.name}]" name="config[{$config_list.name}][{$config_list_option.name}]" class="select" size="1">
                      {foreach name=config_list_option_value from=$config_list_option_value item=item}
                        {if $config_list.value_array[$config_list_option.name] == $item.candidate_value}
                        <option value="{$item.candidate_value}" selected>{$item.candidate_name}({$item.candidate_value})</option>
                        {else}
                        <option value="{$item.candidate_value}">{$item.candidate_name}({$item.candidate_value})</option>
                        {/if}
                      {/foreach}
                      </select>
                    {else}
                      <select id="config[{$config_list.name}]" name="config[{$config_list.name}]" class="select" size="1">
                      {foreach name=config_list_option_value from=$config_list_option_value item=item}
                        {if $config_list.value == $item.candidate_value}
                        <option value="{$item.candidate_value}" selected>{$item.candidate_name}({$item.candidate_value})</option>
                        {else}
                        <option value="{$item.candidate_value}">{$item.candidate_name}({$item.candidate_value})</option>
                        {/if}
                      {/foreach}
                      </select>
                    {/if}
                  {else}
                    {if $config_list.if_multi != '1'}{$config_list.value}{else}{$config_list.value_array|@implode}{/if}
                  {/if}
                {elseif $config_list_option.type == "radio"}
                  {if $config_list_option_value|@is_array && $config_list_option_value|@count > 0}
                    {if $config_list.if_multi == '1'}
                      {foreach name=config_list_option_value from=$config_list_option_value item=item}
                        {if $config_list.value_array[$config_list_option.name] == $item.candidate_value}
                        <input type="radio" id="config[{$config_list.name}][{$config_list_option.name}]" name="config[{$config_list.name}][{$config_list_option.name}]" value="{$item.candidate_value}" class="radio_y" checked />&nbsp;{eval var=$item.candidate_name}
                        {else}
                        <input type="radio" id="config[{$config_list.name}][{$config_list_option.name}]" name="config[{$config_list.name}][{$config_list_option.name}]" value="{$item.candidate_value}" class="radio_y" />&nbsp;{eval var=$item.candidate_name}
                        {/if}
                      {/foreach}
                    {else}
                      {foreach name=config_list_option_value from=$config_list_option_value item=item}
                        {if $config_list.value == $item.candidate_value}
                        <input type="radio" id="config[{$config_list.name}]" name="config[{$config_list.name}]" value="{$item.candidate_value}" class="radio_y" checked />&nbsp;{eval var=$item.candidate_name}
                        {else}
                        <input type="radio" id="config[{$config_list.name}]" name="config[{$config_list.name}]" value="{$item.candidate_value}" class="radio_y" />&nbsp;{eval var=$item.candidate_name}
                        {/if}
                      {/foreach}
                    {/if}
                  {else}
                    {if $config_list.if_multi != '1'}{$config_list.value}{else}{$config_list.value_array|@implode}{/if}
                  {/if}
                {elseif $config_list_option.type == "input"}
                  {if $config_list.if_multi == '1'}
                      <input type="text" id="config[{$config_list.name}][{$config_list_option.name}]" name="config[{$config_list.name}][{$config_list_option.name}]" maxlength="255" size="36" value="{$config_list.value_array[$config_list_option.name]}" class="input">
                  {else}
                      <input type="text" id="config[{$config_list.name}]" name="config[{$config_list.name}]" maxlength="255" size="36" value="{$config_list.value}" class="input">
                  {/if}
                {elseif $config_list_option.type == "textarea"}
                  {if $config_list.if_multi == '1'}
                      <textarea id="config[{$config_list.name}][{$config_list_option.name}]" name="config[{$config_list.name}][{$config_list_option.name}]" rows="6" cols="36" class="textarea">{$config_list.value_array[$config_list_option.name]}</textarea>
                  {else}
                      <textarea id="config[{$config_list.name}]" name="config[{$config_list.name}]" rows="6" cols="36" class="textarea">{$config_list.value}</textarea>
                  {/if}
                {else}
                      {if $config_list.if_multi != '1'}{$config_list.value}{else}{$config_list.value_array|@implode}{/if}
                {/if}
                <span id="{$config_list.name}_{$key}_return"><span class="prompt_primal"></span></span>
              </td>
            </tr>
            {/foreach}
          {else}
            <tr>
              <td class="block_right">
                {if $config_list.if_multi != '1'}{$config_list.value}{else}{$config_list.value_array|@implode}{/if}
              </td>
            </tr>
          {/if}
          </table>
          </td>
          <td width="30%" class="block_right">{if $config_list.unit != ""}({$config_list.unit}){/if}{$config_list.brief|str_entag:'space,br'}</td>
        </tr>
        {/foreach}
        <tr>
          <td colspan="3" align="center" class="block_footer">
          <input type="button" id="config_submit" name="config_submit" value="编辑" class="button"
            onclick="xajax.$('config_submit').disabled=true;
                     xajax.$('config_submit').value='请等待...';
                     xajax_submit_form('amend',xajax.getFormValues('config_amend'),'config_submit');">
          </td>
        </tr>
      </table>
      </form>
      </div>
      {/if}

    </td>
  </tr>
</table>
{include file="pub_footer.htm"}